home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cgraphix / baseaddr.asm < prev    next >
Assembly Source File  |  1986-05-14  |  690b  |  39 lines

  1.     Title - BaseAddress - assembler implementation of GRAPHIX routine
  2. ;«TS8,16,24,32,40,48,56,64,72»
  3.     include    model.h
  4.     include    prologue.h
  5.  
  6.     public    BaseAddress
  7.  
  8. BAY    equ    @ab[bp]
  9.  
  10.  
  11. BaseAddress    proc    near
  12.  
  13.     push    bp
  14.     mov    bp,sp
  15.  
  16.     mov    ax,BAY            ;get row address
  17.     mov    ah,al            ;duplicate address in AH
  18.     and    ax,01FEh        ;mask AX to get rid of unwanted data
  19.                     ;  AH = row mod 2
  20.                     ;  AL = 2 * (row \ 2)
  21.     sal    ax,1            ;*4
  22.     sal    ax,1            ;*8
  23.     sal    ax,1            ;*16
  24.     mov    bx,ax            ;store 16 multiple
  25.     and    bh,7            ;  lower byte register only
  26.     sal    ax,1            ;*32
  27.     sal    ax,1            ;*64
  28.     add    ax,bx            ;combine multiples to get offset
  29.  
  30.     pop    bp
  31.     ret
  32.  
  33. BaseAddress    endp
  34.  
  35.     include    epilogue.h
  36.  
  37.     end
  38.  
  39.